home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / What's New? / Development Kits / Apple Game Sprockets DR1 / Examples / NetSprocketTest / CPlayerWindow.cp next >
Encoding:
Text File  |  1996-04-24  |  1.2 KB  |  84 lines  |  [TEXT/CWIE]

  1. #include "CPlayerWindow.h"
  2.  
  3. CPlayerWindow::CPlayerWindow()
  4. {
  5. }
  6.  
  7. CPlayerWindow::CPlayerWindow(
  8.     LStream    *inStream) : LWindow(inStream)
  9. {
  10. }
  11.  
  12. CPlayerWindow::~CPlayerWindow()
  13. {
  14. }
  15.  
  16. CPlayerWindow*
  17. CPlayerWindow::CreatePlayerWindowStream(
  18.     LStream    *inStream)
  19. {
  20.     return (new CPlayerWindow(inStream));
  21. }
  22.  
  23.  
  24. void CPlayerWindow::FinishCreateSelf(void)
  25. {
  26.     mUp = mDown = mLeft = mRight = false;
  27.     
  28.     mUpRect.top = 20;
  29.     mUpRect.bottom = 36;
  30.     mUpRect.left = 40;
  31.     mUpRect.right = 56;
  32.     
  33.     mDownRect.top = 40;
  34.     mDownRect.bottom = 56;
  35.     mDownRect.left = 40;
  36.     mDownRect.right = 56;
  37.     
  38.     mLeftRect.top = 40;
  39.     mLeftRect.bottom = 56;
  40.     mLeftRect.left = 60;
  41.     mLeftRect.right = 76;
  42.     
  43.     mRightRect.top = 40;
  44.     mRightRect.bottom = 56;
  45.     mRightRect.left = 20;
  46.     mRightRect.right = 36;
  47.     
  48.     mPulseRect.top = 5;
  49.     mPulseRect.bottom = 10;
  50.     mPulseRect.left = 5;
  51.     mPulseRect.right = 10;
  52.     
  53. }
  54.  
  55.  
  56. void CPlayerWindow::DrawSelf()
  57. {
  58.     Rect r;
  59.     
  60.     if (mUp)
  61.         PaintRect(&mUpRect);
  62.     else
  63.         EraseRect(&mUpRect);
  64.         
  65.     if (mDown)
  66.         PaintRect(&mDownRect);
  67.     else
  68.         EraseRect(&mDownRect);
  69.  
  70.     if (mLeft)
  71.         PaintRect(&mLeftRect);
  72.     else
  73.         EraseRect(&mLeftRect);
  74.  
  75.     if (mRight)
  76.         PaintRect(&mRightRect);
  77.     else
  78.         EraseRect(&mRightRect);
  79.         
  80.     if (mPulse)
  81.         PaintRect(&mPulseRect);
  82.     else
  83.         EraseRect(&mPulseRect);
  84. }